﻿/****************************** Module Header ******************************\

Copyright (c) Gary Davidson

This source is subject to the Microsoft Public License.
See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
All other rights reserved.

THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
\***************************************************************************/
using System.Collections.Generic;
using Microsoft.EnterpriseManagement.Common;
using Microsoft.EnterpriseManagement.Configuration;

namespace Savviety.ServiceManager.Facade.ExtensionMethods
{
    public static partial class ExtensionMethods
    {

        //ManagementPackClass connectorClass = connectorManagementPack.GetClass(ConnectorManagementPackName);

        // this is an instantiation
        //var connectorObject = new CreatableEnterpriseManagementObject(SCSMServer.CurrentManagementGroup, connectorClass);

        public static CreatableEnterpriseManagementObject CreateInstance (this ManagementPackClass mpc)
        {
           return new CreatableEnterpriseManagementObject(SCSMServer.CurrentManagementGroup, mpc);
        }


        public static string CreateWeeklyDailySchedule(this ManagementPackDataSourceModule module, IList<WeeklyDays> weeklyDays)
        {

            return new WeeklyDailySchedule(weeklyDays).ScheduleXml;

        }

        public static string CreateWeeklyMultipleDaysSchedule(this ManagementPackDataSourceModule module, IList<WeeklyMultipleDays> weeklyDays)
        {

            return new WeeklyMultipleDaysSchedule(weeklyDays).ScheduleXml;

        }

        public static string CreateSimpleSchedule(this ManagementPackDataSourceModule module, int timeInterval, IntervalUnitsType intervalUnitsType)
        {

            return new SimpleReccuringSchedule(timeInterval, intervalUnitsType).ScheduleXml;

        }

        //WeeklyMultipleDaysSchedule

         
    }
}
